package com.fowo.api.mapper;

import com.fowo.api.entity.AmazonOrderList;
import com.fowo.api.entity.AmazonOrderListProduct;
import com.fowo.api.entity.Product;
import com.fowo.api.entity.ShopInfo;
import com.fowo.api.model.lingxing.ListingFatherTemp;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface LingXingInterfaceMapper {

    /**
     * 根据sku查询产品数
     * @param sku
     * @return
     */
    Integer checkSku(@Param("sku") String sku);

    /**
     * 根据sku查询产品id
     */
    Long getIdBySku(@Param("sku") String sku);

    /**
     * 根据时间删除数据
     * @param startDate
     */
    void deleteByStartDate(@Param("startDate") String startDate);

    /**
     * 根据时间删除数据 fba出库单
     * @param startDate
     */
    void deleteByStartDate1(@Param("startDate") String startDate);

    /**
     * 根据时间段删除数据
     * @param startDate
     * @param endDate
     */
    void deleteReportByDate(@Param("startDate") String startDate, @Param("endDate") String endDate);

    /**
     * 根据wid查询仓库ID
     * @param wid
     * @return
     */
    Long getWarehouseIdByWid(@Param("wid") String wid);

    /**
     * 根据领星店铺id查询系统店铺id
     * @param sellerId
     * @return
     */
    String getShopNameBySellerId(@Param("sellerId") String sellerId);

    String getShopCode();

    int insertOrder(List<AmazonOrderList> list);

    int insertOrderProduct(List<AmazonOrderListProduct> list);

    Integer selectCount(String amazonOrderId,String shopCode);

    void createLingFatherTempTable();

    int addListingFatherTemp(List<ListingFatherTemp> list);

    List<Product> getIdsBySkus(String[] skuArray);

    List<ShopInfo> getIdsByCodes(String[] codeArray);

    void syncListingFather(Integer batchNumber);

    void updateDelListing(Long syncFlag);

    List<String> getWmsOrderIdWithErr();

}
